package com.yhzhou.test;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

@Path("/apps")
public class Apps {

    @GET
    @Path("list")
    @Produces(MediaType.TEXT_PLAIN)
    public String getPredictApps(@QueryParam("appOpen") String appOpen,
                                 @QueryParam("location") String location,
                                 @QueryParam("wifi") String wifi,
                                 @QueryParam("blueTooth") Boolean blueTooth,
                                 @QueryParam("dataConn") Boolean dataConn,
                                 @QueryParam("charge") Boolean charge,
                                 @QueryParam("audio") Boolean audio) {

        System.out.println("appOpen: "+appOpen);
        System.out.println("location: "+location);
        System.out.println("wifi: "+wifi);
        System.out.println("blueTooth: "+blueTooth);
        System.out.println("dataConn: "+dataConn);
        System.out.println("charge: "+charge);
        System.out.println("audio: "+audio);

        // TODO append to tan-data in mem 10 times

        String app = "com.tencent.mm";
        test test2 = new test();
        test2.main2(app);
        return "1 5 2 4 0"; // TODO return 5 real apps from perdict
    }

}

